package com.mjf.enum_demo;

import java.util.Arrays;

public class EnumUse {

    public static void main(String[] args) {

        System.out.println(SeasonEnum.AUTUMN.getSeasonDesc());
        System.out.println(Arrays.toString(SeasonEnum.values()));
        System.out.println(SeasonEnum.valueOf("SUMMER").getSeasonName());

    }
}

enum SeasonEnum {
    SPRING("春天","春风又绿江南岸"),
    SUMMER("夏天","映日荷花别样红"),
    AUTUMN("秋天","秋水共长天一色"),
    WINTER("冬天","窗含西岭千秋雪");

    private final String seasonName;
    private final String seasonDesc;
    private SeasonEnum(String seasonName, String seasonDesc) {
        this.seasonName = seasonName;
        this.seasonDesc = seasonDesc;
    }
    public String getSeasonName() {
        return seasonName;
    }
    public String getSeasonDesc() {
        return seasonDesc;
    }

}


